package com.qfjy.homework.huangjie;


/**
 * @author:黄杰
 * @date:
 * @version:1.0
 */
public class Person {
    String name;//姓名
    int age;//年龄
    Sex sex;//性别
    int requestAge;//要求年龄
    Agency agency;//中介

    public Person(String name, int age, Sex sex, int requestAge, Agency agency) {
        this.name = name;
        this.age = age;
        this.sex = sex;
        this.requestAge = requestAge;
        this.agency = agency;
        agency.register(this);
    }
    //寻找对象
    public void findPartner(){
        agency.pair(this);
    }
}
enum Sex{
    MALE,FEMALE;
}
